<?php namespace simpleFlow\error;

/**
 * Exceptions
 * @package simpleFlow
 * @subpackage error
 * @author Guilherme Fontenele
 */
class Exception extends \Exception
{
	/**
	 * Constructor
	 * @param string $strMessage Exception messagem
	 * @param integer $intCode Exception code 
	 */
	public function __construct($strMessage = null,$intCode = 0)
	{
		if(!$message)
		{
			throw new $this('Unknown '.\get_class($this));
		}
		$strTemplate = 'simpleFlow>> ';
		
		parent::__construct($strTemplate.$strMessage,$intCode);
	}
	
	/**
	 * Gets the exception message
	 * @return string Message
	 */
	public function __toString()
	{
		return get_class($this) . " '{$this->message}' in {$this->file}({$this->line})\n{$this->getTraceAsString()}";
	}
}

?>